//
//  UIView+Extention.m
//  WYP_weiBo_01_(下拉菜单)
//
//  Created by lanou3g on 15/12/5.
//  Copyright © 2015年 王艳苹. All rights reserved.
//

#import "UIView+Extention.h"

@implementation UIView (Extention)

-(CGFloat)x{
    return self.frame.origin.x;
}
-(void)setX:(CGFloat)x{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

-(CGFloat)y{
    return self.frame.origin.y;
}
-(void)setY:(CGFloat)y{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}

-(CGFloat)width{
    return self.frame.size.width;
}
- (void)setWidth:(CGFloat)width{
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}

-(CGFloat)hight{
    return self.frame.size.height;
}
- (void)setHight:(CGFloat)hight{
    CGRect frame = self.frame;
    frame.size.height = hight;
    self.frame = frame;
}

-(CGFloat)centerX{
    return self.center.x;
}
- (void)setCenterX:(CGFloat)centerX{
    CGPoint point = self.center;
    point.x =  centerX;
    self.center = point;
}

-(CGFloat)centerY{
    return self.center.y;
}

-(void)setCenterY:(CGFloat)centerY{
    CGPoint point = self.center;
    point.y = centerY;
    self.center = point;
}

-(CGSize)size{
    return self.frame.size;
}
-(void)setSize:(CGSize)size{
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}

-(CGPoint)ponit{
    return self.frame.origin;
}

- (void)setPonit:(CGPoint)ponit{
    CGRect frame = self.frame;
    frame.origin = ponit;
    self.frame = frame;
}
@end
